package com.edu.service.impl;


import com.edu.entity.Email;
import com.edu.service.IEmailService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RabbitMQProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendEmail(Email email) {
        rabbitTemplate.convertAndSend("exchange", "email", email);
    }
}